package com.example.gymmanagement.controller;


import com.example.gymmanagement.Utils.Result;
import com.example.gymmanagement.domain.LoginParam;
import com.example.gymmanagement.domain.User;
import com.example.gymmanagement.service.LoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
@ApiOperation("登录")
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping
    @ApiOperation("登录")
    public Result login(@RequestBody LoginParam loginParam){
        //验证用户，访问用户表
       return loginService.login(loginParam);

    }



}
